#ifndef __TRACK_H__
#define __TRACK_H__

#include "ctnode.h"

#define TRACK_CAST(x) ((Track *)(x))

typedef struct _Track
{
  void (*process_node)(struct _Track *, CTNode *);
  void (*finalize)(struct _Track *);
  int bpm;
  int beats;
  int avol;
  int qvol;
  int evol;
  int svol;
  int tvol;
  int accel;
} Track;

void track_create (Track *track);
void track_set_bpm (Track *track, int bpm);
void track_set_beats (Track *track, int beats);
void track_set_accent_vol (Track *track, int vol);
void track_set_quarter_vol (Track *track, int vol);
void track_set_eighth_vol (Track *track, int vol);
void track_set_sixteenth_vol (Track *track, int vol);
void track_set_triplet_vol (Track *track, int vol);
void track_set_accel (Track *track, int accel);

/* Default callbacks */
void track_process_node (Track *track, CTNode *node);
void track_finalize (Track *track);

#endif
